package com.example.littleSpider.myapplication.activity;

import android.graphics.Color;
import android.support.design.widget.BottomSheetDialog;
import android.view.View;
import android.widget.RelativeLayout;

import com.example.littleSpider.myapplication.R;
import com.example.littleSpider.myapplication.base.BaseActivity;
import com.example.littleSpider.myapplication.myInterfaces.MethodInTitle;
import com.example.littleSpider.myapplication.view.TitleView;
import com.weigan.loopview.LoopView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by EDZ on 2017/12/13.
 */

public class SendInfoActivity extends BaseActivity implements MethodInTitle{


    @BindView(R.id.title_view)
    TitleView mTitleView;
    @BindView(R.id.layout_dot)
    RelativeLayout layout_dot;
    private BottomSheetDialog dialog;
    LoopView loopView;
    @Override
    protected int getLayoutRes() {
        return R.layout.activity_sendinfo;
    }

    @Override
    protected void initView() {
        mTitleView.initMyTitle("填写寄件人", this);
        mTitleView.hideTitleTextImage();
        mTitleView.showRightTwo(false);
    }


    @Override
    protected void initData() {

    }

    @OnClick({R.id.layout_dot})
    public void clickSend(View view){
        switch (view.getId()){
            case R.id.layout_dot:
                openBottomDot();
                break;
        }
    }

    /**
     * 从底部弹出的选择网点dialog
     */

    private void openBottomDot() {
        dialog = new BottomSheetDialog(this);
        dialog.setContentView(R.layout.bottom_itemdot);

        List<String> items = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            items.add("张老三" + i);
        }
        loopView = (LoopView) dialog.findViewById(R.id.loop_view_dot);
        loopView.setNotLoop();
        loopView.setItems(items);
        loopView.setCenterTextColor(Color.BLUE);
        loopView.setTextSize(20);

        loopView.setInitPosition(0);

        dialog.show();

    }

    @Override
    public void setGoBack() {
        finish();
    }

    @Override
    public void onRightOne() {

    }

    @Override
    public void onRightTwo() {

    }

    @Override
    public void onTitleText() {

    }
}
